{
    let {a, b} = {a: 'Hello', b: "world"};
    console.log(a ,b)
    console.log("-------------------------------------------------------")
}
{
    let {a, c, b} = {b: "world", a: 'Hello'}
    console.log("a:" + a);   //a:Hello
    console.log("b:" + b);   //b:world
    console.log("c:" + c);   //c:undefined
    console.log("-------------------------------------------------------")
}
{
    let {a1: a, b1: b} = {a1: 'Hello', b1: "World"};
    console.log(a);  //Hello 
    console.log(b);  //World
//  console.log(a1); //a1 is not defined
//  console.log(b1)  //b1 is not defined
console.log("-------------------------------------------------------")
}
{
    let obj={
        a:[
            'Hello',
            {c: 'world'}
        ]
    }
    let {a:[b, {c}]} = obj
    //console.log(a);  //a is not defined
    console.log(b);    //Hello
    console.log(c);    //world
    console.log("-------------------------------------------------------")
}
{
    let obj={
        a:[
            'Hello',
            {c: 'world'}
        ]
    }
    let {a, a:[b, {c}]} = obj
    console.log(a);    // [ 'Hello', { c: 'world' } ]
    console.log(b);    // Hello
    console.log(c);    // world
    console.log("-------------------------------------------------------")
}

{
    const obj = {
        a: {
            b: {
                c:{ d: "hello" },
                e: 'world'
            }
        }
    }
    let {a, a: {b}, a: {b: {c}}, a:{b:{e}}, a:{b: {c:{d}}}} = obj;
    console.log("a", a);   // a { b: { c: { d: 'hello' }, e: 'world' } }
    console.log("b", b);   // b { c: { d: 'hello' }, e: 'world' }
    console.log("c", c);   // c { d: 'hello' }
    console.log("d", d);   // d hello
    console.log("e", e);   // e world
    console.log("-------------------------------------------------------")
}

{
    let obj = {};
    let arr = [];
//  let { a: obj.prop, b: arr[0] } = {a: "Hello", b:'World'}   //Unexpected token .
    ({ a: obj.prop, b: arr[0] } = {a: "Hello", b:'World'})
    console.log(obj);    // { prop: 'Hello' }
    console.log(arr);    // [ 'World' ]
    console.log("-------------------------------------------------------")
}
{
    let {a, b = 2} = {a: 'Hello'}
    console.log(a, b)   // Hello 2

    let {c, d = 2} = {c: 'Hello', d:"World"}
    console.log(c, d);  // Hello World
    var {x: y = 3} = {};
    console.log(y) // 3

    var {x: y = 3} = {x: 5};
    console.log(y) // 5

    var {x = 3} = {x: undefined};
    console.log(x) // 3

    var {x = 3} = {x: null};
    console.log(x) // null
    console.log("-------------------------------------------------------")
}
{
    let arr=['Tom','Jerry','Kitty','Danny','Jenny','Lucy']
    let {0: first, [arr.length-4]:thrid} = arr;
    console.log(first);  //Tom
    console.log(thrid);  //Kitty
    console.log("-------------------------------------------------------")
}
{
    let {} = {a: 0};
    let {} = "Hello";
    let {} = [1, 2];
    console.log("Come Here")
}